# Check exported Xcode project (optional)

After you build your unity project for iOS target, unity's 'Console Tab' will show log messages that a post-build script has executed and its result like below.

If the build script has executed successfully, console tab will show log message like "AppSealing asset has applied to exported Xcode project successfully !!". When this log message has not shown you can refer to trouble-shooting section to manually fix this error.

# Open unity-exported Xcode project

# Select top project at Project Navigator and select "Unity-iPhone" target at TARGETS

Supposing the python script has executed successfully, you will see the "Other Linker Flags" value start with "-lStaticAppSec ..." at each configuration such as Debug / Release / ReleaseForProfilling / ReleaseForRunning. If this value is empty, refer to trouble-shooting section to resolve script error.

# Reminds about Xcode build mode

* AppSealing work differently in debug mode and release mode.

If you build an app in Debug mode, AppSealing`s security features are disabled for convenient development :

  • Jailbreak detection

  • Anti-debugging

  • Not encrypted executable file detection

  • App-Integrity corruption detection

  • Re-signing detection

These features are enabled when you build app as Release mode.

You will build the app as Release mode when distributing to the App Store. If you test AppSealing with Release mode, your app should be distributed to App Store or 'TestFlight'. If not, the executable file will be detected as not encrypted, so the app will be closed.

# Generate App integrity & certificate verification snapshot

There is additional process to verify app integrity & certificate when you test your app or distribute app through app store. If you skip this step the app running on device will be terminated after few seconds for broken app integrity.

When distributing app built in Release mode through Development or Ad Hoc it will be terminated for security check which tells the executable has not encrypted by Fairplay DRM so skipping this step will have the same result, but you should process this step when you distribute your app through TestFlight or App Store.

Let’s see the upload process to App Store or TestFlight step by step. Below is Organizer window after Archive from Xcode.

Click “Distribute App” button to generate IPA for uploading to App Store.

Click “Next” button with “App Store Connect” is selected.

You usually selected “Upload” almost but you must select “Export” to apply AppSealing. This is because taking snapshot for app integrity and certificate is needed and your app will not run normally on device without this process. Click “Next” button with “Export” is selected.

Click “Next” button with all options keep default.

With default options retained, click “Next” button. Then you can see the window from which you can export as an IPA.

Verify the brief contents and click “Export” button.

When destination dialog appear select store location and click “Export” button. This document used folder named “~/Downloads/Unity-iPhone_Upload”

After you’ve clicked “Export” button IPA file will be created at the designated folder. You can see the generated IPA file at finder like below. Now, you should keep in mind the location of IPA or remain finder widow opened.

Now you should process next step with exported IPA. Launch terminal app and move to Xcode project folder.

This document used project path for unity-exported Xcode project as “~/Documents/ xcode_project_appsealing_pizza”. You can verify the path name by pwd command like above picture.

Run add permission command like below.

$ chmod +x Libraries/AppSealingSDK/Tools/*
$ open Libraries/AppSealingSDK/Tools/generate_genesis

When you first install the SDK and open the generate_genesis file for the first time, the following warning window may appear.

In this case, click the OK button to close the window, then go to the settings window and click the “Security and Privacy” item.

Select the “General” tab on the left and click the “Open Anyway” button at the bottom.

Click “Open” button when another confirmation window appears after clicking the “Open Anyway” button.

New terminal window will show the execution result of “Open” action, just close the window.

Now you run ‘generate_hash’ script like below. This script has only one parameter which is path to the exported IPA file in previous step. You can type the IPA path manually or drag & drop the IPA file from the opened Finder window in previous step.

$ Libraries/AppSealingSDK/Tools/generate_hash ~/Downloads/Unity-iPhone_Upload/pizza.ipa

After you execute the script you will see the progress like below and snapshot for app integrity and certificate will be added to the IPA file.

This process has to be applied to distribution step as “Ad Hoc”, “Enterprise”, “Development” identically.

# Upload re-signed IPA to App Store Connect

Now you can upload re-signed IPA to App Store Connect. This document uses Transporter app (MAC) for convenient uploading. If the Transporter app has not installed in your MAC you can open Mac AppStore, search “Transporter” and install.

Launch Transporter after installation you are requested for Apple ID like below. Enter your Apple ID and password. (This step is required only once for the first time)

After you login with your ID and password you can see the Transporter window like below. Click the “+” button upper-left or “ADD APP” button in the middle to select IPA to be uploaded and select the re-signed IPA in previous step.

When you update your app by adding IPA file with new version or higher build number a warning dialog can appear like below because of same bundle ID. In this case just click “Replace” button to upload new IPA.

After IPA file has added, click “DELIVER” button then verifying and uploading to App Store Connect process will be in progress.

If you encounter below window the upload process has finished and you can submit your build for App Store review or TestFlight distribution.

Last Updated: 11/19/2024, 6:55:37 AM